home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
STOpen.z
/
STOpen
Wrap
Text File
|
1998-10-30
|
5KB
|
133 lines
SSSSTTTTOOOOppppeeeennnn((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSTTTTOOOOppppeeeennnn((((3333))))
NNNNAAAAMMMMEEEE
STOpen, STClose - open/close a STIFF file stream
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
####iiiinnnncccclllluuuuddddeeee <<<<ssssttttiiiiffffffff....hhhh>>>>
SSSSTTTTSSSSttttrrrreeeeaaaammmm**** SSSSTTTTOOOOppppeeeennnn((((iiiinnnntttt ffffdddd,,,, iiiinnnntttt ffffllllaaaaggggssss))));;;;
iiiinnnntttt SSSSTTTTCCCClllloooosssseeee((((SSSSTTTTSSSSttttrrrreeeeaaaammmm ****sssstttt))));;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_S_T_O_p_e_n opens a STIFF stream for the specified file descriptor. The
SSSSTTTTSSSSttttrrrreeeeaaaammmm pointer returned by _S_T_O_p_e_n is a handle used by many _l_i_b_s_t_i_f_f
functions. _f_d is a file descriptor obtained from a system call such as
_o_p_e_n(_2), _p_i_p_e(2), or _s_o_c_k_e_t(2), or from a call to _f_i_l_e_n_o(_3_S). The _f_l_a_g_s
parameter specifies how the STIFF stream should be opened. Specifying
_f_l_a_g_s as SSSSTTTT____RRRREEEEAAAADDDD opens the stream for reading. Specifying SSSSTTTT____WWWWRRRRIIIITTTTEEEE opens
the stream for writing. The value specified for _f_l_a_g_s should agree with
the file descriptor's open mode. That is, if _f_d is a read-only
descriptor, _f_l_a_g_s should be SSSSTTTT____RRRREEEEAAAADDDD. _l_i_b_s_t_i_f_f does not support reading
and writing on the same stream.
_S_T_C_l_o_s_e writes a terminating empty IFD (if _s_t was open for writing) and
closes the STIFF stream previously opened by a call to _S_T_O_p_e_n.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
_S_T_O_p_e_n returns a pointer to a newly opened STIFF stream if execution was
successful. NULL is returned and _S_T_e_r_r_n_o is set if an execution error has
occurred.
_S_T_C_l_o_s_e returns 0 if execution was successful. -1 is returned and _S_T_e_r_r_n_o
is set if an execution error has occurred.
WWWWAAAARRRRNNNNIIIINNNNGGGG
STIFF stream information is maintained with the _S_T_S_t_r_e_a_m structure by the
_l_i_b_s_t_i_f_f functions. For this reason all reading and writing to a STIFF
stream should be done using only _l_i_b_s_t_i_f_f functions. Use of other
functions (e.g. _w_r_i_t_e(_2)) to perform STIFF stream I/O will lead to
unexpected results and is strongly discouraged.
EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
_S_T_O_p_e_n will fail under the following circumstances.
STEBADSTREAM Invalid STIFF stream.
STEWRITETOREAD Attempt to write to a read only stream.
STEREADFROMWRITE Attempt to read from a write stream.
PPPPaaaaggggeeee 1111
SSSSTTTTOOOOppppeeeennnn((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSTTTTOOOOppppeeeennnn((((3333))))
STESYSCALL System call failed.
_S_T_C_l_o_s_e will fail under the following circumstances.
STENEEDSEEK Operation requires seeking on a stream.
STESYSCALL System call failed.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
libstiff(3).
PPPPaaaaggggeeee 2222